<?php
/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 2018-06-11
 * Time: 17:25
 */

namespace app\api\model;


class Prize extends BaseModel
{
    protected $table = 'we_prize';
    protected $hidden = [];

    // 自动写入时间戳
    // protected $autoWriteTimestamp = true;
    // 设置自动写入时间的格式
    protected $autoWriteTimestamp = 'datetime';

    // 读取器
    public function getUrlAttr($value){
        $finalUrl = $value;
        if(substr($value,0,4) === 'http'){
            return $finalUrl;
        }else{
            $finalUrl = config('setting.medisum_img_prefix').$value;
        }
        return $finalUrl;
    }

}